package com.feign.instance;

import com.feign.bean.HiHystrix;
import com.feign.config.FeignConfig;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @ClassName: TestFeignInstance
 * @Author: ZhangYue26
 * @Description: 测试FeignClient接口
 * @Date: 2021-01-12
 */
@FeignClient(value = TestFeignInstance.FEIGN_APPLICATION_NAME,configuration = FeignConfig.class,fallback = HiHystrix.class)
public interface TestFeignInstance {
    public final static String FEIGN_APPLICATION_NAME = "eureka-server-colony-1"; /** 这个名称是远程服务名称 spring.application.name */

    @GetMapping(value = "/test")
    String sayHello(@RequestParam(value = "name",required = false)String name);

}
